#!/bin/sh

# Create directory for the socket if OpenRC is not present (e.g. in container).
# It's conditioned using post-install script specifically to avoid easily
# overlookable mistakes in the init script (service working until the
# first restart).
if ! [ -e /sbin/openrc ]; then
	install -d -m 755 -o redict -g redict /run/redict
fi

ver_old=$2

if [ "$(apk version -t "$ver_old" '7.3.0-r2')" = '<' ]; then
	cat >&2 <<-EOF
	*
	* redict-cli and redict-benchmark have been moved to separate subpackages.
	* If you use it, run: apk add redict-cli redict-benchmark
	*
	EOF
fi

exit 0
